#include<stdio.h>
#include<math.h>
int a[1005][1005] = {0};
void sm(int m1,int m2,int n1,int n2)
{
    for(int i = m1; i<=m2;i++)
    {
        for(int j = n1;j<=n2;j++)
        {
            a[i][j] = 0;
        }
    }
}
void jc(int m1,int m2,int n1,int n2)
{
    if(m1 == m2) a[m1][n1] = 1;
    else
    {
        sm(m1,(m2-m1+1)/2,n1,(n2-n1+1)/2);
        jc((m2-m1+1)/2+1,m2,n1,(n2-n1+1)/2);
        jc(m1,(m2-m1+1)/2,(n2-n1+1)/2+1,n2);
        jc((m2-m1+1)/2+1,m2,(n2-n1+1)/2+1,n2);
    }
}
int main()
{
    //freopen("in.txt","r",stdin);
    int n;
    scanf("%d",&n);
    int k = (int)pow(2,n);
    //printf("%d",k);
    jc(1,k,1,k);
    for(int i = 1; i<=k;i++)
    {
        for(int j = 1; j<=k;j++)
        {
            printf("%d ",a[i][j]);
        }
        printf("\n");
    }
}